package com.shxt.framework.rbac.weeklycontent.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import com.shxt.framework.commons.exception.ServiceExceiption;
import com.shxt.framework.rbac.weeklycontent.dao.WeeklyContentDao;
import com.shxt.framework.rbac.weeklycontent.model.WeeklyContent;
import com.shxt.framework.rbac.weeklycontent.service.WeeklyContentService;

public class WeeklyContentServiceImpl implements WeeklyContentService{
	@Autowired
	private WeeklyContentDao wcDao;

	//暂时没有写关于加载自己的所有日志
	@Override
	public List<WeeklyContent> getAllWeeklyContentList() {
		return this.wcDao.load();
	}

	@Override
	public void add( WeeklyContent wc ) {
		this.wcDao.add(wc);
	}

	@Override
	public void update( WeeklyContent wc ) {
		this.wcDao.update(wc);
	}

	@Override
	public void updateAndDeleteWCStatus( WeeklyContent wc ) {
		try {
			this.wcDao.updateAndDeleteWCStatus(wc);
		} catch (Exception ex) {
			ex.printStackTrace();//给开发人员使用
			throw new ServiceExceiption("删除用户日志失败！！！");
		}
	}

	@Override
	public List<WeeklyContent> query(WeeklyContent wc) {
		return wcDao.query(wc);
	}
}
